package com.hz.user.interfaces.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hz.base.beans.vo.CommonResult;
import com.hz.base.beans.vo.PageEntity;
import com.hz.base.beans.vo.QueryParams;
import com.hz.beans.code.HzOperateCode;
import com.hz.beans.user.entity.TConsuReply;
import com.hz.common.beans.constant.DemoResult;
import com.hz.interfaces.user.inf.ITConsuReplyInterface;
import com.hz.user.service.inf.ITConsuReplyService;

/**
 * ITConsuReplyService
 * @author mcz
 * @since [0.0.1]
 * @version [0.0.1,2018年10月19日]
 */
@Service("tConsuReplyInterface")
public class TConsuReplyInterface implements ITConsuReplyInterface{
	
	@Autowired
	private ITConsuReplyService tConsuReplyService;
	

	@Override
	public CommonResult<TConsuReply> queryTConsuReply(Long id) {
		CommonResult<TConsuReply> cr = new DemoResult<>();
		cr = tConsuReplyService.selectByPrimaryKey(cr,id);
		cr.setOperate(HzOperateCode.QUERY_TCONSUREPLY);
		return cr;
	}

	@Override
	public TConsuReply queryTConsuReplyByconsuID(Long consuID) {
		return tConsuReplyService.queryTConsuReplyByconsuID(consuID);
	}

	@Override
	public CommonResult<TConsuReply> addTConsuReply(TConsuReply tConsuReply) {
		CommonResult<TConsuReply> cr = new DemoResult<>();
		cr = tConsuReplyService.insert(cr, tConsuReply);
		cr.setOperate(HzOperateCode.ADD_TCONSUREPLY);
		return cr;
	}
	
	@Override
	public CommonResult<PageEntity> queryForPage(QueryParams<TConsuReply> queryParams) {
		CommonResult<PageEntity> cr = new DemoResult<>();
		cr = tConsuReplyService.queryForPage(cr, queryParams);
		cr.setOperate(HzOperateCode.QUERY_TCONSUREPLY_PAGE);
		return cr;
	}

	@Override
	public CommonResult<List<TConsuReply>> queryTConsuReplyList(QueryParams<TConsuReply> queryParams) {
		CommonResult<List<TConsuReply>> cr = new DemoResult<>();
		cr = tConsuReplyService.queryForList(cr, queryParams);
		cr.setOperate(HzOperateCode.QUERY_TCONSUREPLY_LIST);
		return cr;
	}

	@Override
	public CommonResult<TConsuReply> updateTConsuReply(TConsuReply tConsuReply) {
		CommonResult<TConsuReply> cr = new DemoResult<>();
		cr = tConsuReplyService.updateByPrimaryKey(cr, tConsuReply);
		cr.setOperate(HzOperateCode.UPDATE_TCONSUREPLY);
		return cr;
	}

	@Override
	public CommonResult<Object> deleteTConsuReplyArray(Long[] ids) {
		CommonResult<Object> cr = new DemoResult<>();
		cr = tConsuReplyService.deleteObjectArray(cr, ids);
		cr.setOperate(HzOperateCode.DELETE_TCONSUREPLY);
		return cr;
	}

	@Override
	public CommonResult<TConsuReply> insertSelective(TConsuReply tConsuReply) {
		CommonResult<TConsuReply> cr = new DemoResult<>();
		cr = tConsuReplyService.insertSelective(cr, tConsuReply);
		cr.setOperate(HzOperateCode.INSERTSELECTIVE_TCONSUREPLY);
		return cr;
	}

	@Override
	public CommonResult<Object> deleteByList(List<TConsuReply> tConsuReplyList) {
		CommonResult<Object> cr = new DemoResult<>();
		cr = tConsuReplyService.deleteByList(cr, tConsuReplyList);
		cr.setOperate(HzOperateCode.DELETELIST_TCONSUREPLY);
		return cr;
	}

	@Override
	public CommonResult<List<TConsuReply>> batchUpdate(List<TConsuReply> tConsuReplyList) {
		CommonResult<List<TConsuReply>> cr = new DemoResult<>();
		cr = tConsuReplyService.batchUpdate(cr, tConsuReplyList);
		cr.setOperate(HzOperateCode.BATCHUPDATE_TCONSUREPLY);
		return cr;
	}

	@Override
	public CommonResult<List<TConsuReply>> batchSave(List<TConsuReply> tConsuReplyList) {
		CommonResult<List<TConsuReply>> cr = new DemoResult<>();
		cr = tConsuReplyService.batchSave(cr, tConsuReplyList);
		cr.setOperate(HzOperateCode.BATCHSAVE_TCONSUREPLY);
		return cr;
	}

}
